<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>汽车对象</title>
	</head>
	<body>
		<h1>保时捷718</h1>
		
		<script>
			//js定义对象
			var car = new Object();
			car.name="保时捷718"//添加动态属性
			car.type="Cayman T"
			car.color="red"
			car.price=641000
			car.show=function(){
				return this.name+this.type
			}
			console.log(car)
			console.log(car.show())
			var car2 ={
				name : "保时捷718",
				note : "这车很不错",
				toString:function(){
					return this.name+","+this.note
				}
				
			}
			console.log(car2);
			console.log(car2.toString());
		</script>
		
	</body>
</html>
